<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link href="<?= base_url()."style/styl.css"?>" rel="stylesheet" type="text/css"/>
        <link rel="stylesheet" type="text/css" href="<?= base_url()."style/tcal.css"?>" />
        <script type="text/javascript" src="<?= base_url()."script/tcal.js"?>" ></script>
        <link rel="icon" type="image/png" href="<?= base_url()."style/icon.png"?>"/>
         <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
        <title><?= $title ?></title>
    </head>
    <body>
        <header>
            <div id="head"><h1>Spoločný kalendár aktivít FMFI</h1></div>	
        </header>
        <nav>
            <?php if ($this->session->userdata('logged_in')) {
              if (isAdmin()){ ?>
                <a class="menu" href="<?= base_url() ?>admin/adduser">Pridať používateľa</a>&nbsp;|
                <a class="menu" href="<?= base_url() ?>admin/getuser">Edituj používateľa</a>&nbsp;|
                <a class="menu" href="<?= base_url() ?>admin/deleteuser">Zmaž používateľa</a>&nbsp;|
                <a class="menu" href="<?= base_url() ?>admin/editevent">Edituj event</a>&nbsp;|
                <a class="menu" href="<?= base_url() ?>admin/update">Update rozvrhov</a>&nbsp;|
                <a class="menu" href="<?= base_url() ?>admin/help">Pomocník</a>&nbsp;|
                <span class='menu' id='user_info'>Ste prihlásený ako <span>admin</span></span>
                <a href="<?= base_url() ?>login/logout" class="menu" title="odhlásiť sa">odhlásiť sa</a>
            <?php }else{ ?>
                <a href="<?= base_url() ?>user/calendar" class="menu" title="zobraz kalendar">zobraziť kalendár</a>&nbsp;|
                <a href="<?= base_url() ?>user/table" class="menu" title="zobraz tabulku">moje eventy</a>&nbsp;|
                <a href="<?= base_url() ?>user/addevent" class="menu" title="pridať event">pridať event</a>&nbsp;|
                <a href="<?= base_url() ?>user/import" class="menu" title="import kalendára">import kalendára</a>&nbsp;|
                <a href="<?= base_url() ?>user/export" class="menu" title="export kalendára">export kalendára</a>&nbsp;|
                <a href="<?= base_url() ?>user/help" class="menu" title="pomocník">pomocník</a>&nbsp;|
                <a href="<?= base_url() ?>user/changePasswd" class="menu" title="zmena hesla">zmena hesla</a>&nbsp;|
                
                <?= "<span class='menu' id='user_info'>Ste prihlásený ako <span>".$this->session->userdata('first_name')." ".$this->session->userdata('surname')."</span></span>"; ?>
                <a href="<?= base_url() ?>login/logout" class="menu" title="odhlásiť sa">odhlásiť sa</a> 	
            <?php 
              }
            } else {?> Musíte byť prihlásení <?php }; ?>
        </nav>
</div>

        <?= $content ?>
  
        <footer>
            <span id="footer"> Site created by DreamTeam, <a href="#head">back to head</a> </span>	
        </footer>


    </body>
</html>